package com.mypack.student.service.course.impl;

import com.github.pagehelper.PageHelper;
import com.mypack.student.dto.course.CourseDTO;
import com.mypack.student.dto.course.CourseSearchDTO;
import com.mypack.student.mapper.CourseMapper;
import com.mypack.student.service.course.CourseService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CourseServiceImpl implements CourseService {

    @Autowired
    private CourseMapper courseMapper;

    @Override
    public List<CourseDTO> listCourse(CourseSearchDTO searchDTO, boolean isPage) {
        if(isPage){
            PageHelper.startPage(searchDTO.getPageNum(),searchDTO.getPageSize());
        }
        return courseMapper.listCourse(searchDTO);
    }

    @Override
    public void add(CourseDTO courseDTO) {

    }

    @Override
    public void update(CourseDTO courseDTO) {

    }

    @Override
    public void delete(CourseDTO courseDTO) {

    }
}
